/*
 *  ABinViewSetting.h
 *  
 *
 *  Created by Peter on 22.02.12.
 *  Copyright 2012 __MyCompanyName__. All rights reserved.
 *
 */

#ifndef A_BIN_VIEW_SETTING_H
#define A_BIN_VIEW_SETTING_H

#include "ASetting.h"
#include <list>

/*
 * This is interesting since it is basically a setting (derived from the 
 * settings base class), but also writtne in AVB (bin) files and referenced by
 * bin objects.
 *
 * Version: 10 (MC 5.0.3 OS X)
 */
class ABinViewSetting : public ASetting
{
	
public:
	
	A_DECLARE_CLASS( 'BVst', ABinViewSetting, ASetting );
	
	/*----- enums & typedefs -----*/
	
	struct Column;
	typedef std::list< Column* > ColumnList;
	
	/*----- member functions -----*/
	
	// Remove all data and reset to defaults
	void clear();
	
	virtual void readFromStream (
		AStream&       str, 
		const AObjDoc& objd
	);
	
	virtual void dump( std::ostream& str ) const;
	
	
	/*----- data members -----*/
	
	ColumnList _columns;
};

struct ABinViewSetting::Column
{
	enum ColumnFormat
	{
		FORMAT_STRING   = 2,
		FORMAT_TIMECODE = 100,
		FORMAT_DATETIME = 102
		// Other values unknown for now
	};
	
	std::string _columnTitle; // "Name", "Creation Date", ...
	Int16       _columnFormat;
	Int16       _columnType;
	bool        _columnHidden;
	
	void readFromStream( AStream& str );
};

#endif /*Inclusion Guard*/